import { GetAlbumInfo } from "apis/index";
Page({
  data: {
    id: "",
    info: {},
    list: [],
  },

  onLoad(options) {
    const { id } = options;
    this.setData({ id });
    this.getInfo();
  },

  onShareAppMessage() {},
  getInfo() {
    const { id } = this.data;
    GetAlbumInfo({ id }).then((res) => {
      console.log(res, "res----------------");
      const { album, songs } = res;
      let info = album || {};
      info.singers = info?.artists.map((it) => it.name).join(" - ");
      this.setData({
        info,
        list: songs || [],
      });
    });
  },
});
